/*************************************************************************
	> File Name: resume.h
	> Author: ma6174
	> Mail: ma6174@163.com 
	> Created Time: 2021年11月25日 星期四 20时17分03秒
 ************************************************************************/

#include<iostream>
#include <string>

class WorkExperience
{
public:
	WorkExperience(std::string w, std::string c) : workDate(w), company(c) {}

	void setWorkDate(std::string w)
	{
		this->workDate = w;
	}

	std::string getWorkDate()
	{
		return this->workDate;
	}

	void setCompany(std::string c)
	{
		this->company = c;
	}

	std::string getCompany()
	{
		return this->company;
	}

	WorkExperience* clone()
	{
		return new WorkExperience(*this);
	}

private:
	std::string workDate;
	std::string company;
};

class Resume
{
public:
	Resume(std::string n, std::string s, std::string a, std::string w, std::string c) : 
		name(n),
		sex(s),
		age(a)
	{
		work = new WorkExperience(w, c);
	}

	void setPersonalInfo(std::string s, std::string a)
	{
		this->sex = s;
		this->age = a;
	}

	void setWorkExperience(std::string w, std::string c)
	{
		work->setWorkDate(w);
		work->setCompany(c);
	}

	void display()
	{
		std::cout << this->name << " " << this->sex << " " << this->age << std::endl;
		std::cout << "工作经历：" << this->work->getWorkDate() << " " << this->work->getCompany() << std::endl;
	}

	Resume* clone()
	{
		return new Resume(this->name, this->sex, this->age, this->work->getWorkDate(), this->work->getCompany());
	}

private:
	std::string name;
	std::string sex;
	std::string age;
	WorkExperience* work;
};

